// /common/http.api.js
// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作，更多内容详见uView对拦截器的介绍部分：
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
import {
	baseURL,
	baseImgUrl,
	Appid
} from '../config/config.js'
import {
	addImgUrl
} from '@/utils/tools.js'
const install = (Vue, vm) => {

	let login = (params = {}) => vm.$u.post(`/wechatMini/auth/wxUser/${Appid}/login`, params).then(res => {

		return res.data
	});
	let addExamineOdd = (params = {}) => vm.$u.get(`/wechatMini/auth/examineOdd/${Appid}/addExamineOdd`, params).then(res => {

		return res.data
	});
	let addUserMainland = (params = {}) => vm.$u.post(`/wechatMini/auth/examineOdd/￥{Appid}/addExamineOddNew`, params).then(
		res => {
			return res.data
		});
	let findExamineOdd = (params = {}) => vm.$u.get(`/wechatMini/auth/examineOdd/${Appid}/findExamineOdd`, params).then(
		res => {
			return res.data
		});
	let findExamineOddInfo = (params = {}) => vm.$u.get(`/wechatMini/auth/examineOdd/${Appid}/findExamineOddInfo`, params)
		.then(
			res => {
				return res.data
			});
	let addCompanyShareholder = (params = {}) => vm.$u.post(
			`/wechatMini/auth/companyShareholder/${Appid}/addCompanyShareholder`, params)
		.then(
			res => {
				return res.data
			});
	let delCompanyShareholder = (params = {}) => vm.$u.get(
			`/wechatMini/auth/companyShareholder/${Appid}/delCompanyShareholder`, params)
		.then(
			res => {
				return res.data
			});
	let addCompanyShareholderInfo = (params = {}) => vm.$u.post(
			`/wechatMini/auth/companyShareholder/${Appid}/addCompanyShareholderInfo`, params)
		.then(
			res => {
				return res.data
			});
	let findCompanyShareholderById = (params = {}) => vm.$u.get(
			`/wechatMini/auth/companyShareholder/${Appid}/findCompanyShareholderById`, params)
		.then(
			res => {
				return res.data
			});
	let addCompanyDirector = (params = {}) => vm.$u.post(
			`/wechatMini/auth/companyDirector/${Appid}/addCompanyDirector`, params)
		.then(
			res => {
				return res.data
			});
	let delCompanyDirector = (params = {}) => vm.$u.get(
			`/wechatMini/auth/companyDirector/${Appid}/delCompanyDirector`, params)
		.then(
			res => {
				return res.data
			});
	let addCompanyDirectorInfo = (params = {}) => vm.$u.post(
			`/wechatMini/auth/companyDirector/${Appid}/addCompanyDirectorInfo`, params)
		.then(
			res => {
				return res.data
			});
	let findCompanyDirectorById = (params = {}) => vm.$u.get(
			`/wechatMini/auth/companyDirector/${Appid}/findCompanyDirectorById`, params)
		.then(
			res => {
				return res.data
			});
	let addCompanyExamineOddNew = (params = {}) => vm.$u.post(
			`/wechatMini/auth/examineOdd/${Appid}/addCompanyExamineOddNew`, params)
		.then(
			res => {
				return res.data
			});
	let register = (params = {}) => vm.$u.post(
			`/wechatMini/auth/wxUser/{appid}/register`, params)
		.then(
			res => {
				return res
			});
	let loginForUserName = (params = {}) => vm.$u.post(
			`/wechatMini/auth/wxUser/{appid}/loginForUserName`, params)
		.then(
			res => {
				return res.data
			});
	vm.$u.api = {
		loginForUserName,
		register,
		addCompanyExamineOddNew,
		findCompanyDirectorById,
		addCompanyDirectorInfo,
		delCompanyDirector,
		addCompanyDirector,
		findCompanyShareholderById,
		addCompanyShareholderInfo,
		login,
		addExamineOdd,
		addUserMainland,
		findExamineOdd,
		findExamineOddInfo,
		addCompanyShareholder,
		delCompanyShareholder

	};
}
export default {
	install
}
